﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Adm_BASICDList.aspx.cs" Inherits="ArtLand.OA.Project.ADM.Adm_BASICDList" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <style type="text/css">
        .highlight {
            background-color: lightyellow;
        }

            .highlight .x-grid3-col {
                background-image: none;
            }

        .x-grid3-row-selected .highlight {
            background-color: yellow;
        }

            .x-grid3-row-selected .highlight .x-grid3-col {
                background-image: none;
            }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <ext:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Grid1" />



        <ext:Grid ID="Grid1" ShowBorder="false" ShowHeader="true"
            Title="行政物资管理" runat="server" DataKeyNames="ID" OnRowDataBound="Grid1_RowDataBound" EnableRowNumber="true" OnRowCommand="Grid1_RowCommand" AllowCellEditing="true" ClicksToEdit="2">
            <Toolbars>
                <ext:Toolbar ID="Toolbar1" runat="server">
                    <Items>
                        <ext:Button ID="btnNew" Text="添加物资" Icon="Add" EnablePostBack="false" runat="server">
                        </ext:Button>
                        <ext:ToolbarSeparator></ext:ToolbarSeparator>

                        <ext:Button ID="Button1" runat="server" Text="保存" Icon="TableSave" OnClick="Button1_Click"></ext:Button>
                        <%--<ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
                        </ext:ToolbarSeparator>
                        <ext:TwinTriggerBox ID="ttbxMyBox2" ShowLabel="false" OnTrigger1Click="ttbxMyBox2_Trigger1Click"
                            OnTrigger2Click="ttbxMyBox2_Trigger2Click" Trigger1Icon="Clear" ShowTrigger1="False"
                            EmptyText="请输入员工编号或员工姓名" Trigger2Icon="Search" runat="server" Width="180px">
                        </ext:TwinTriggerBox>--%>
                    </Items>
                </ext:Toolbar>
            </Toolbars>
            <Columns>
                <ext:RenderField Width="120px" ColumnID="MaterNo" DataField="MaterNo" FieldType="String"
                    HeaderText="物资编号">
                    <Editor>
                        <ext:TextBox runat="server" ID="txt_MaterNo"></ext:TextBox>
                    </Editor>
                </ext:RenderField>

                <ext:RenderField Width="130px" ColumnID="MaterTitle" DataField="MaterTitle" FieldType="String"
                    HeaderText="物料名称">
                    <Editor>
                        <ext:TextArea runat="server" ID="txt_MaterTitle"></ext:TextArea>
                    </Editor>
                </ext:RenderField>
                <ext:RenderField Width="70px" TextAlign="Center" ColumnID="MaterUnit" DataField="MaterUnit" FieldType="String"
                    HeaderText="基本单位">
                    <Editor>
                        <ext:DropDownList runat="server" ID="Drp_MaterUnit"></ext:DropDownList>
                    </Editor>
                </ext:RenderField>
                
                <ext:RenderField Width="70px" TextAlign="Center" ColumnID="MaterColor" DataField="MaterColor" FieldType="String"
                    HeaderText="颜色">
                    <Editor>
                        <ext:DropDownList runat="server" ID="Drp_MaterColor"></ext:DropDownList>
                    </Editor>
                </ext:RenderField>
                <ext:RenderField Width="70px" TextAlign="Center" ColumnID="MaterBrand" DataField="MaterBrand" FieldType="String"
                    HeaderText="品牌">
                    <Editor>
                        <ext:DropDownList runat="server" ID="Drp_MaterBrand"></ext:DropDownList>
                    </Editor>
                </ext:RenderField>
                <ext:RenderField Width="70px" TextAlign="Center" ColumnID="MaterModel" DataField="MaterModel" FieldType="String"
                    HeaderText="规格">
                    <Editor>
                        <ext:DropDownList runat="server" ID="Drp_MaterModel"></ext:DropDownList>
                    </Editor>
                </ext:RenderField>
                <ext:BoundField Width="80px" DataField="INVQTY" ToolTip="asdf" HeaderText="库存数量" />
                <%-- 

                <ext:RenderField Width="90px" ColumnID="TipData"  DataField="TipData" 
                    Renderer="Date" RendererArgument="yyyy-MM-dd"  HeaderText="提醒日期" TextAlign="Center">
                    <Editor>
                        <ext:DatePicker runat="server" ID="txt_TipData" DateFormatString="yyyy-MM-dd"></ext:DatePicker>
                    </Editor>
                </ext:RenderField>

                <ext:RenderField Width="140px" ColumnID="TipMail" DataField="TipMail" FieldType="String"
                    HeaderText="提醒人邮箱地址">
                    <Editor>
                        <ext:TextBox runat="server" ID="txt_TipMail"></ext:TextBox>
                    </Editor>
                </ext:RenderField>
                <ext:BoundField Width="65px"  DataField="REMARK" ToolTip="asdf" HeaderText="提醒状态"/>--%>
                <ext:RenderField Width="160px" ColumnID="REMARK" DataField="REMARK" FieldType="String"
                    HeaderText="备注">
                    <Editor>
                        <ext:TextArea runat="server" ID="txt_REMARK"></ext:TextArea>
                    </Editor>
                </ext:RenderField>
                <ext:LinkButtonField ConfirmText="您确定要删除该条记录吗？" ConfirmTarget="Top" ColumnID="ID"
                    Width="40px" CommandName="Del" Icon="Delete" TextAlign="Center" />
                <ext:BoundField DataField="ID" Hidden="true" />
            </Columns>
        </ext:Grid>
        <ext:HiddenField ID="highlightRows" runat="server">
        </ext:HiddenField>
    </form>
    <script type="text/javascript">
        var highlightRowsClientID = '<%= highlightRows.ClientID %>';
        var gridClientID = '<%= Grid1.ClientID %>';

        function highlightRows() {
            var highlightRows = X(highlightRowsClientID);
            var grid = X(gridClientID);

            grid.el.select('.x-grid3-row table.highlight').removeClass('highlight');

            Ext.each(highlightRows.getValue().split(','), function (item, index) {
                if (item !== '') {
                    var row = grid.getView().getRow(parseInt(item, 10));
                    Ext.get(row).first().addClass('highlight');
                }
            });

        }

        // 页面第一个加载完毕后执行的函数
        function onReady() {
            var grid = X(gridClientID);
            grid.addListener('viewready', function () {
                highlightRows();
            });
        }

        // 页面AJAX回发后执行的函数
        function onAjaxReady() {
            highlightRows();
        }
    </script>
    <script src="../js/extgridbug.js"></script>

</body>
</html>
